<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>首页</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/l-style.css" rel="stylesheet">
    <link type="text/css" rel="stylesheet" href="css/bootstrap-datetimepicker.min.css">
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/pop_status.js"></script>
    <script src="js/common.js"></script>
</head>
<body>
<div class="container">
    <div class="header">
        <div class="header-fl fl">科技小桌板</div>
        <div class="header-fr fr">
            <img src="img/icon/default-avatar.png" width="28" height="28" class="default-avatar fl">
            <span class="admin-name fl">Sherry</span>
            <img src="img/icon/exit-icon.png" width="16" height="16" class="login-exit fr">
        </div>
    </div>

    <div class="super-admin">
        <img src="img/icon/s-admin.png" width="70" height="71">
        <span class="super-text">超级管理员</span>
    </div>

    <div class="sidebar">
        <div class="panel-group" id="accordion">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                        <div>
                            <a class="sidebar-list" href="index.html" data-id="1">
                                <span class="sidebar-icon">
                                    <span class="side1"></span>
                                </span>
                                <span class="">首页</span>
                                <span class="r-arrow"></span>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                        <div data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
                            <a class="sidebar-list" data-id="2" >
                                <span class="sidebar-icon">
                                    <span class="side2"></span>
                                </span>
                                <span class="">消息通知</span>
                                <span class="r-arrow"></span>
                            </a>
                        </div>
                    </div>
                </div>
                <div id="collapseTwo" class="panel-collapse collapse">
                    <div class="panel-body">
                        <ul class="son-sidebar">
                            <li>
                                <a class="sidebar-son-list" data-id="1" href="gg1.html">公告列表</a>
                            </li>
                            <li>
                                <a class="sidebar-son-list" data-id="2" href="px1.html">培训通知</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                        <div>
                            <a class="sidebar-list" data-id="3"  href="ry1.html">
                                <span class="sidebar-icon">
                                    <span class="side3"></span>
                                </span>
                                <span class="">人员管理</span>
                                <span class="r-arrow"></span>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                        <div>
                            <a class="sidebar-list" data-id="4" href="qy1.html">
                                <span class="sidebar-icon">
                                    <span class="side4"></span>
                                </span>
                                <span class="">企业信息管理</span>
                                <span class="r-arrow"></span>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                        <div>
                            <a class="sidebar-list" data-id="5" href="sb1.html">
                                <span class="sidebar-icon">
                                    <span class="side5"></span>
                                </span>
                                <span class="">申报看板</span>
                                <span class="r-arrow"></span>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                        <div>
                            <a class="sidebar-list" data-id="6" href="wj1.html">
                                <span class="sidebar-icon">
                                    <span class="side6"></span>
                                </span>
                                <span class="">文件管理</span>
                                <span class="r-arrow"></span>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                        <div data-toggle="collapse" data-parent="#accordion" href="#collapseSeven">
                            <a class="sidebar-list" data-id="7">
                                <span class="sidebar-icon">
                                    <span class="side7"></span>
                                </span>
                                <span class="">账号管理</span>
                                <span class="r-arrow"></span>
                            </a>
                        </div>
                    </div>
                </div>
                <div id="collapseSeven" class="panel-collapse collapse">
                    <div class="panel-body">
                        <ul class="son-sidebar">
                            <li>
                                <a class="sidebar-son-list" href="zh2.html" data-id="1">普通管理员账号管理</a>
                            </li>
                            <li>
                                <a class="sidebar-son-list" href="zh1.html" data-id="2">科技联络人审核</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="panel-title">
                        <div data-toggle="collapse" data-parent="#accordion" href="#collapseEight">
                            <a class="sidebar-list" data-id="8">
                                <span class="sidebar-icon">
                                    <span class="side8"></span>
                                </span>
                                <span class="">系统设置</span>
                                <span class="r-arrow"></span>
                            </a>
                        </div>
                    </div>
                </div>
                <div id="collapseEight" class="panel-collapse collapse">
                    <div class="panel-body">
                        <ul class="son-sidebar">
                            <li>
                                <a class="sidebar-son-list" href="xt3.html" data-id="1">个人信息</a>
                            </li>
                            <li>
                                <a class="sidebar-son-list" href="xt7.html" data-id="2">修改密码</a>
                            </li>
                            <li>
                                <a class="sidebar-son-list" href="xt5.html" data-id="3">企业类别管理</a>
                            </li>
                            <li>
                                <a class="sidebar-son-list" href="xt6.html" data-id="4">企业属性管理</a>
                            </li>
                            <li>
                                <a class="sidebar-son-list" href="xt1.html" data-id="5">Banner图管理</a>
                            </li>
                            <li>
                                <a class="sidebar-son-list" href="xt8.html" data-id="6">注册协议管理</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="page-header">
        <div class="page-right-top">
            <div class="right-top">
                <span class="right-title">申报看板</span>
            </div>
            <div class="top-nav top-nav-active">添加项目</div>
        </div>
        <div class="main-content">
            <form id="member-submit">
                <div class="mes-content" style="margin-top: 0;padding-top: 40px;">
                    <div class="add-mem-box">
                        <div class="mem-left fl">项目名称</div>
                        <input type="text" class="mem-right fl" name="name" placeholder="请输入项目名称">
                        <div class="clearfix"></div>
                    </div>
                    <div class="add-mem-box">
                        <div class="mem-left fl">项目类型</div>
                        <input type="text" class="mem-right fl" name="name" placeholder="请输入项目类型">
                        <div class="clearfix"></div>
                    </div>
                    <div class="add-mem-box">
                        <div class="mem-left fl">项目进度</div>
                        <div class="fl" style="margin-left: 42px;">

                            <div class="add-speed-box"></div>

                            <div class="speed-progress">
                                <div class="mes-input fl mes-date">
                                    <span class="date-icon"></span>
                                    <div class="form-group">
                                        <div class="right col-xs-6 text-left">
                                            <div class="input-group">
                                                <input type="text" style="width: 114px;" class="form-control form_datetime" id="addtime" name="addtime" placeholder="开始时间">
                                                <span class="input-group-addon" id="basic-addon"><span class="glyphicon glyphicon-time" aria-hidden="true"></span></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="mes-input fl mes-date">
                                    <span class="date-icon"></span>
                                    <div class="form-group">
                                        <div class="right col-xs-6 text-left">
                                            <div class="input-group">
                                                <input type="text" style="width: 114px;" class="form-control form_datetime" id="addtimes" name="addtime" placeholder="结束时间">
                                                <span class="input-group-addon" id="basic-addon2"><span class="glyphicon glyphicon-time" aria-hidden="true"></span></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="mes-input fl" style="width: 190px;">
                                    <input type="text" class="keyword-input" style="width: 172px;" placeholder="请输入项目进度">
                                </div>

                                <button class="mes-query-btn fl" type="button">添加进度</button>

                                <div class="clearfix"></div>
                            </div>
                        </div>

                        <div class="clearfix"></div>
                    </div>
                    <div class="add-mem-box">
                        <div class="mem-left fl">项目文件</div>
                        <label class="upload-btn fl" for="upload_file">点击上传</label>

                        <input type="file" id="upload_file">
                        <div class="clearfix"></div>
                    </div>
                    <div class="add-mem-box" style="margin-top: 40px;">
                        <div class="mem-left fl"></div>
                        <div class="acc-opera-btn fl mem-btn" style="margin-left: 42px;">发布</div>
                        <div class="acc-opera-btn fl mem-cancel">取消</div>
                    </div>

                    <div class="clearfix"></div>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<script src="js/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {

        SidebarHighlighting('5');

        $('.form_datetime').datetimepicker({
            minView: "month", //选择日期后，不会再跳转去选择时分秒
            language:  'zh-CN',
            format: 'yyyy-mm-dd',
            todayBtn:  1,
            autoclose: 1
        });

        // 点击查询
        $('.mes-query-btn').on('click', function() {
            var keyword = $('.keyword-input');
            var start_time = $('#addtime');
            var end_time = $('#addtimes');

            if (start_time.val() == '') {
                popStatus(2, '请选择开始时间', 1,'', true);
                return;
            }

            if (end_time.val() == '') {
                popStatus(2, '请选择结束时间', 1,'', true);
                return;
            }

            if (start_time.val() > end_time.val()) {
                popStatus(2, '开始时间不得大于结束时间', 1,'', true);
                return;
            }

            if (keyword.val() == '') {
                popStatus(2, '请输入项目进度', 1,'', true);
                return;
            }

            $('.reset-icon').remove();

            var is_bg = '';

            var list_length = $('.add-speed-list').length;

            if (list_length % 2 == 0) {
                is_bg = 'add-bg';
            } else {
                is_bg = 'add-bg2';
            }

            var html = '<div class="add-speed-list '+ is_bg +'">\
                            <div class="add-speed-fl fl">'+ start_time.val() +'至'+ end_time.val() +'</div>\
                            <div class="add-speed-fr fr">'+ keyword.val() +'</div>\
                            <div class="clearfix"></div>\
                            <div class="reset-icon"></div>\
                        </div>';

            $('.add-speed-box').css('margin-bottom', '15px').prepend(html);

            start_time.val(''); end_time.val(''); keyword.val('');
        });

        // 点击项目进度删除按钮
        $('body').on('click', '.reset-icon', function() {

            var list_length = $('.add-speed-list').length;

            // 列表为1时  ->  margin-bottom == 0;
            if (list_length == 1) {
                $('.add-speed-box').css('margin-bottom', '0');
            } else {
                // 给下一个元素追加删除按钮
                $(this).parents('.add-speed-list').next('.add-speed-list').find('.add-speed-fr').after('<div class="reset-icon"></div>');
            }

            // 删除列表
            $(this).parents('.add-speed-list').remove();

        });

        $(".mem-btn").on('click', function(){
            var param = $('#member-submit').serializeObject();

            console.log(param)
        })
    })
</script>
</body>
</html>